# Use the official Golang
# image as the base image
FROM golang:latest

# Set the working directory
# inside    the   container
WORKDIR /app

# Copy the local    source       files
# to the container's working directory
COPY . .

# set environmental variable
ENV OWNER=makarov

# Define a build-time argument
# for   the    web server port
ARG port=$port

ENV PORT=$port

# Build the Golang application
# with  the     specified port
RUN go mod init server
RUN go build -o main .

# Expose the port on which
# the web  server will run
EXPOSE $port

# Command to run the executable
# when  the    container starts
CMD ./main

